package cn.myjerry.io.convert;

import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;

/**
 * 转换流：字节转为字符
 * 1、输出流：OutputStreamWriter	编码
 * 2、输入流：InputStreamReader	解码
 * @author zpon
 *
 */
public class ConvertDemo02 {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(
				new InputStreamReader(
						new FileInputStream(
								new File("/Users/zpon/Desktop/test.txt")
								), "UTF-8"
						)
				);
		String str = null;
		while(null != (str = br.readLine())) {
			System.out.println(str);
		}
		br.close();
	}
}
